//
// See the file COPYING for redistribution information.
//

#include <cstdio>
#include <Naipax/Common.hpp>
#include <Naipax/Error.hpp>

using namespace std;
using namespace Naipax;

Error::Error(int32_t ErrorCode, uint32_t Line,
             string Filename) : _mErrorCode(ErrorCode),
                                _mLine(Line),
                                _mFilename(Filename) {
}
 
const string Error::What() {
    char Buf[32];
    snprintf(Buf, 32, "%u", this->_mLine);
    return ErrorMessages[this->_mErrorCode] + " at line " + Buf
        + " of file " + this->_mFilename + "\n";
}
